<?php
class ORMpz_expense extends ORMBase {
  public function __construct() {
    parent::__construct('pz_expense');
  }

  public function __toEpObject($myManager, $epObject, $object) {
    $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
    $epObject->createdDate = (isset($object->createdDate) && $object->createdDate) ? SimpleDate::toStamp($object->createdDate) : 0;
    $epObject->payDate = (isset($object->payDate) && $object->payDate) ? SimpleDate::toStamp($object->payDate) : 0;
    $epObject->payee = isset($object->payee) ? $object->payee : '';
    $epObject->particular = isset($object->particular) ? $object->particular : '';
    $epObject->category = isset($object->category) ? $object->category : '';
    $epObject->amount = isset($object->amount) ? $object->amount : 0;
    $epObject->method = isset($object->method) ? $object->method : '';
    $epObject->chequeNumber = isset($object->chequeNumber) ? $object->chequeNumber : 0;
    $epObject->all_branch = isset($object->all_branch) ? $object->all_branch : 0;
    $epObject->auckland = isset($object->auckland) ? $object->auckland : 0;
    $epObject->sydney = isset($object->sydney) ? $object->sydney : 0;
    $epObject->melbourne = isset($object->melbourne) ? $object->melbourne : 0;
    $epObject->newyork = isset($object->newyork) ? $object->newyork : 0;
    $epObject->xtraordinary = isset($object->xtraordinary) ? $object->xtraordinary : 0;
    $epObject->brisbane = isset($object->brisbane) ? $object->brisbane : 0;
    $epObject->note = isset($object->note) ? $object->note : '';
    $epObject->userTrackId = isset($object->userTrackId) ? $object->userTrackId : '';
    $epObject->userAccount = isset($object->userAccount) ? $object->userAccount : '';
    $epObject->status = isset($object->status) ? $object->status : 0;
    $epObject->cancelledDate = (isset($object->cancelledDate) && $object->cancelledDate) ? SimpleDate::toStamp($object->cancelledDate) : 0;
    $epObject->cancelledOperator = isset($object->cancelledOperator) ? $object->cancelledOperator : '';
    $epObject->cancelledMessage = isset($object->cancelledMessage) ? $object->cancelledMessage : '';
    return $epObject;
  }

  public function __toObject($myManager, $epObject, $object) {
    $object->id = $epObject->oid;
    $object->trackId = $epObject->trackId;
    $object->createdDate = ($epObject->createdDate != 0) ? SimpleDate::fromStamp($epObject->createdDate) : 0;
    $object->payDate = ($epObject->payDate != 0) ? SimpleDate::fromStamp($epObject->payDate) : 0;
    $object->payee = $epObject->payee;
    $object->particular = $epObject->particular;
    $object->category = $epObject->category;
    $object->amount = $epObject->amount;
    $object->method = $epObject->method;
    $object->chequeNumber = $epObject->chequeNumber;
    $object->all_branch = $epObject->all_branch;
    $object->auckland = $epObject->auckland;
    $object->sydney = $epObject->sydney;
    $object->melbourne = $epObject->melbourne;
    $object->newyork = $epObject->newyork;
    $object->xtraordinary = $epObject->xtraordinary;
    $object->brisbane = $epObject->brisbane;
    $object->note = $epObject->note;
    $object->userTrackId = $epObject->userTrackId;
    $object->userAccount = $epObject->userAccount;
    $object->status = $epObject->status;
    $object->cancelledDate = ($epObject->cancelledDate != 0) ? SimpleDate::fromStamp($epObject->cancelledDate) : 0;
    $object->cancelledOperator = $epObject->cancelledOperator;
    $object->cancelledMessage = $epObject->cancelledMessage;
    return $object;
  }
}
?>
